//
//  YLManualCheckinViewController.m
//  TheTenthAnniversaryOfMobileUnion
//
//  Created by kuangbiao on 2019/1/24.
//  Copyright © 2019 kuangbiao. All rights reserved.
//

#import "YLManualCheckinViewController.h"
#import "Header.h"
#import "YLManualCheckSearchViewController.h"

@interface YLManualCheckinViewController ()
@property (weak, nonatomic) IBOutlet UIView *pwdBacView;
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;
@property (weak, nonatomic) IBOutlet UITextField *pwdTxt;

@end

@implementation YLManualCheckinViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
}

- (void)initView{
    self.pwdBacView.layer.cornerRadius = 23.5;
    self.pwdBacView.layer.borderColor = [UIColor colorWithHexString:@"C7C7C7"].CGColor;
    self.pwdBacView.layer.borderWidth = 1.0f;
    self.loginBtn.layer.cornerRadius = 23.5;
}

#pragma mark - 登录按钮点击事件
extern NSString *kServerHttpBaseUrl;
- (IBAction)loginBtnClickAction:(id)sender {
    
    
    NSString *url = [NSString stringWithFormat:@"%@%@",kServerHttpBaseUrl,kSceneHandLogin_url];
    NSDictionary *params = @{@"loginPwd":self.pwdTxt.text?:@""};
    [HttpRequest requestWithURLString:url parameters:params type:HttpRequestTypePost success:^(id responseObject) {
        NSDictionary *dict = responseObject;
        YLHttpModel *httpModel = [YLHttpModel yy_modelWithDictionary:dict];
        if([httpModel.status isEqualToString:@"200"]){
            YLManualCheckSearchViewController *searchVC = [[YLManualCheckSearchViewController alloc] initWithNibName:@"YLManualCheckSearchViewController" bundle:nil];
            [self.navigationController pushViewController:searchVC animated:YES];
        }else{
            [KDAlertView alertWithMessage:httpModel.msg?:@""];
        }
        
    } failure:^(NSError *error) {
        [KDLoadFrame withState:KDLoadStateError];
    }];
}


@end
